<link href="__DK__/css/main.css" rel="stylesheet">
<link href="__DK__/css/responsive.css" rel="stylesheet">
<header id="header">
    <div class="container">
        <div class="row">
            <div class="col-sm-12 overflow">
                <div class="social-icons pull-right">
                    <ul class="nav nav-pills">
                        <li>
                            <a href=""><i class="fa fa-facebook"></i></a>
                        </li>
                        <li>
                            <a href=""><i class="fa fa-twitter"></i></a>
                        </li>
                        <li>
                            <a href=""><i class="fa fa-google-plus"></i></a>
                        </li>
                        <li>
                            <a href=""><i class="fa fa-dribbble"></i></a>
                        </li>
                        <li>
                            <a href=""><i class="fa fa-linkedin"></i></a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="navbar navbar-inverse" role="banner">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">
                    <h1><img src="__DK__/images/logo.png" alt="logo"></h1>
                </a>
            </div>
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown" id="shou">
                        <a href="{:url('portal/index/index')}">首页</a>
                    </li>
                    <li class="dropdown" id="lian-xi">
                        <a href="{:url('portal/index/contact')}">联系我们</a>
                    </li>
                    <li class="dropdown" id="din-dan-cha-xun">
                        <a href="{:cmf_url('portal/index/selectorder')}">订单查询</a>
                    </li>
                    <li class="dropdown" id="tou-su">
                        <a href="{:cmf_url('portal/index/ComplaintProgress')}">投诉查询</a>
                    </li>
                    <if cmf_is_user_login()>
                        <li class="dropdown ">
                            <a href="{:cmf_url('user/Profile/center')}">个人中心</a>
                        </li>
                        <li class="dropdown">
                            <a href="{:cmf_url('user/Index/logout')}">退出</a>
                        </li>
                        <else/>
                        <li class="dropdown zhucean tzzc">
                            <a>注册</a>
                        </li>
                        <li class="dropdown dengluan tzdl">
                            <a>登录</a>
                        </li>
                    </if>

                </ul>
            </div>
            <div class="search">
                <form role="form">
                    <i class="fa fa-search"></i>
                    <div class="field-toggle">
                        <input type="text" class="search-form" autocomplete="off" placeholder="Search">
                    </div>
                </form>
            </div>
        </div>
    </div>
</header>
<div class="register">
    <div class="register1">

        <img src="__DK__/images/guanbilogo.png" class="guanbian"/>
        <h4 class="register1tit">注册</h4>
        <form action="{:url('user/register/doRegister')}" method="post" id="zhu-ce">
            <input type="text" name="username" placeholder="请输入您的邮箱" class="registername"/>
            <input type="password" name="password" placeholder="请输入您的密码" class="registerpass"/>
            <input type="password" name="repassword" placeholder="请再次输入您的密码" class="registerpass1"/>
            <button type="submit" class="ljzc">立即注册</button>
        </form>
        <p>已有账号<span class="tzdl">立即登录</span></p>
    </div>
</div>
<div class="login">
    <div class="register1">

        <img src="__DK__/images/guanbilogo.png" class="guanbian"/>
        <h4 class="register1tit">登录</h4>
        <form action="{:url('user/login/doLogin')}" method="post" id="deng-ru">
            <input type="text" name="username" placeholder="请输入您的邮箱" class="loginrname"/>
            <input type="password" name="password" placeholder="请输入您的密码" class="loginpass"/>
            <button type="submit" class="ljdl">立即登录</button>
        </form>
        <p>还没账号？<span class="tzzc">立即注册</span></p>
    </div>
</div>
<script>
    $(function () {
        $('.tzdl').on('click', function () {
            $('.login').show()
            $('.register').hide()
        })

        $('.tzzc').on('click', function () {
            $('.login').hide()
            $('.register').show()
        })
        $('.guanbian').on('click', function () {
            $('.register').hide()
            $('.login').hide()
        })

        //注册提交
        $('#zhu-ce').submit(function () {
            var $this = $(this);
            $.post($(this).attr('action'), $(this).serialize(), function (da) {
                if (da.code == 0) {
                    sweetAlert(da.msg, '注册提示', 'error');
                } else {
                    swal({
                        title: da.msg
                        , text: '注册提示'
                        , type: 'success'
                    }).then(function () {
                        $this[0].reset();
                    })
                }
            })
            return false;
        })

        //登入
        $('#deng-ru').submit(function () {
            var $this = $(this);
            $.post($this.attr('action'),$this.serialize(),function (da) {
                if (da.code == 0) {
                    sweetAlert(da.msg, '登入提示', 'error');
                } else {
                   location.href="{:cmf_url('user/profile/center')}";
                }
            })
            return false;
        })


        $(function () {
            $('#[name]').addClass('active')
        })
    })
</script>

